package com.oocl.util;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class ResourceCloser {
	
	public static void release(ObjectOutputStream out,ObjectInputStream in,Socket socket,ServerSocket serverSocket){
		try {
			if(null!=out){
				out.close();
			}
			if(null!=in){
				in.close();
			}
			if(null != socket){
				socket.close();
			}
			if(null != serverSocket){
				serverSocket.close();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
